package com.example.mystoryapp2.domain

import com.example.mystoryapp2.R
import com.example.mystoryapp2.contexts.AppContext

class Category {

    private var categoryId: Int? = null

    private var categoryName: String? = null

    fun getCategoryId(): Int? {
        return categoryId
    }

    fun setCategoryId(categoryId: Int?) {
        this.categoryId = categoryId
    }

    companion object {
        fun getUnKnow(): Category {
            var category = Category()
            category.setCategoryName(AppContext.application.getString(R.string.str_unknow))
            return category;
        }
    }

    fun getCategoryName(): String {
        if (categoryName == null) {
            return "unknow"
        } else {
            return categoryName as String
        }
    }

    fun setCategoryName(categoryName: String?) {
        this.categoryName = categoryName
    }

    override fun toString(): String {
        return "Category{" +
                "categoryId = " + categoryId +
                ", categoryName = " + categoryName +
                "}"
    }
}